<h1>Reservas</h1>

<table class = 'index_view'>
  <tr>
	<th>Hospede</th>
	<th>Quarto</th>
	<th>Inicio</th>
	<th>Encerramento</th>
	<th>Status</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @reservas.each do |reserva| %>
  <tr>
	<td><%= link_to reserva.hospede.nome, reserva.hospede %></td>
	<td><%= link_to reserva.quarto.numero, reserva.quarto %></td>
	<td><%= reserva.data_entrada_hospedagem %></td>
	<td><%= reserva.data_saida_hospedagem %></td>
	<td><%= reserva.status %></td>
    <td><%= link_to 'Detalhes', reserva %></td>
    <td><%= link_to 'Remover', reserva, confirm: 'Tem certeza?', method: :delete %></td>
    <% if reserva.status == "Aberta" %>
    	<td><%= link_to "Confirmar", confirmar_reserva_path(:reserva_id => reserva.id) %></td>
    <% end %>
  </tr>
<% end %>
</table>

<br />
